package edu.upf.opencities.dao;

import java.util.List;

import javax.xml.datatype.XMLGregorianCalendar;

import edu.upf.opencities.datamodel.OSNEntry;
import edu.upf.opencities.datamodel.OSNService;

public interface ServiceDAO {

	
	
	/**
	 * DAO register service method
	 * 
	 * @param IdOSNService
	 * @param mail
	 * @param serviceName
	 * @param servicePassword
	 * @param owner
	 * @param description
	 * @param updatePeriod
	 * @param section
	 * @param longitude
	 * @param latitude
	 * @param tagList
	 */
	public String registerService (String mail, String serviceName, 
			String servicePassword, String owner, String description, 
			String updatePeriod, String section, 
			String latitude, String  longitude, List<String> tagList );
	
	
	/**
	 * DAO delete service method
	 * 
	 * @param idOSNService
	 */
	public void deleteService( String idOSNService );
	
	
	/**
	 * DAO get service method
	 * 
	 * @param IdOSNService
	 * @return
	 */
	public OSNService getService ( String idOSNService );
	
	/**
	 * DAO get services method by mail owner
	 * 
	 * @return
	 */
	public List<OSNService> getServicesByMail( String mail );
	
	/**
	 * DAO get services method by section
	 * 
	 * @return
	 */
	public List<OSNService> getServicesBySection( String section );
	
	/**
	 * DAO get services method by tag
	 * 
	 * @return
	 */
	public List<OSNService> getServicesByTag( String tag );
	
	/**
	 * DAO add entry method
	 * 
	 * @param IdOSNService
	 * @param IdOSNEntry
	 * @param timeStamp
	 * @param value
	 */
	public String addEntry( String idOSNService, XMLGregorianCalendar timeStamp, 
			String value, String longitude, String latitude );
	
	
	/**
	 * DAO get entries from service method
	 * 
	 * @param idOSNService
	 * @return
	 */
	
	public List<OSNEntry> getEntriesFromService( String idOSNService, int numEntries );
	
	
	/**
	 * DAO get Last entry method
	 * 
	 * @param idOSNService
	 * @return
	 */
	public OSNEntry getLastEntry( String idOSNService );
	
	
	/**
	 * DAO add Twitter user method
	 * 
	 * @param idOSNService
	 * @param consumerKey
	 * @param consumerSecret
	 * @param token
	 * @param tokenSecret
	 */
	public void addTwitter (String idOSNService, 
			String consumerKey, String consumerSecret,
			String token, String tokenSecret);
	
//	/**
//	 * DAO get Twitter method
//	 * 
//	 * @param idOSNService
//	 * @return
//	 */
//	public OSNService getTwitter (String idOSNService);
	

	/**
	 * DAO login service method
	 * 
	 * @param idOSNService
	 * @param servicePassword
	 * @return
	 */
	public boolean loginService(String idOSNService, String servicePassword);
	
}
